package com.example.laundry.dto;

import com.example.laundry.entity.LaundryItemEntity;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class LaundryItemDto {
    private Long id;
    private Long orderId;
    private String itemName;
    private String itemType;
    private Integer quantity;
    private BigDecimal unitPrice;
    private String notes;

    public static LaundryItemDto fromEntity(LaundryItemEntity entity) {
        LaundryItemDto dto = new LaundryItemDto();
        dto.setId(entity.getId());
        dto.setOrderId(entity.getOrder().getId());
        dto.setItemName(entity.getItemName());
        dto.setItemType(entity.getItemType());
        dto.setQuantity(entity.getQuantity());
        dto.setUnitPrice(entity.getUnitPrice());
        dto.setNotes(entity.getNotes());
        return dto;
    }
}